import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index'
import app from '../views/app'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index,
    redirect:'/home',
    children:[{
      path:'/home',
      component: ()=>import('@/views/Home')
    },  {
      path: '/login',
      component: ()=>import('@/views/Login')
    }]
  },
  {
    path: '/app',
    component: app,
    redirect: '/app/video',
    children: [{
      path: '/app/video',
      component:()=>import('@/views/myVideo')
    },
      {
        path: '/app/videoTemplate',
        component:()=>import('@/views/videoTemp')
      },{
        path: '/app/editVideo',
        component:()=>import('@/views/editVideo')
      }]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
